Fix some IPP compliance issues. (#391523, Albrecht Dress)
authorMatthias Clasen <mclasen@redhat.com>
Mon, 1 Jan 2007 23:47:45 +0000 (23:47 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 1 Jan 2007 23:47:45 +0000 (23:47 +0000)
2007-01-01  Matthias Clasen  <mclasen@redhat.com>

        Fix some IPP compliance issues.  (#391523, Albrecht Dress)

        * modules/printbackends/cups/gtkcupsutils.c
        (gtk_cups_request_encode_option): Use IPP_TAG_JOB, not
        IPP_TAG_OPERATION.
        * modules/printbackends/cups/gtkprintbackendcups.c
        (gtk_print_backend_cups_print_stream): Don't add the
        requesting-user-name attribute a second time.

svn path=/trunk/; revision=17002

ChangeLog
modules/printbackends/cups/gtkcupsutils.c
modules/printbackends/cups/gtkprintbackendcups.c

index 0d1a5cbaa06ca31f6c1dfa49618635f43dd0c961..e80f578c9d681c7e97ac7d9d465a26fdd6752574 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2007-01-01  Matthias Clasen  <mclasen@redhat.com>
+
+       Fix some IPP compliance issues.  (#391523, Albrecht Dress)
+
+       * modules/printbackends/cups/gtkcupsutils.c
+       (gtk_cups_request_encode_option): Use IPP_TAG_JOB, not
+       IPP_TAG_OPERATION.
+       * modules/printbackends/cups/gtkprintbackendcups.c
+       (gtk_print_backend_cups_print_stream): Don't add the
+       requesting-user-name attribute a second time. 
+
 2007-01-01  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkimcontextsimple.c: Fix en/em dash confusion.  (#378462)
index e2e4b157adfb3a0df9cd0117825395a435e9f278..db790c89d53f39b98dbe32ba84c6ecf5b7b83f31 100644 (file)
@@ -364,10 +364,15 @@ _find_option_tag (const gchar *option)
     }
 }
 
+/*
+ * Note that this function uses IPP_TAG_JOB, so it is
+ * only suitable for IPP Group 2 attributes.
+ * See RFC 2911.
+ */
 void
 gtk_cups_request_encode_option (GtkCupsRequest *request,
                                 const gchar    *option,
-                               const gchar    *value)
+                               const gchar    *value)
 {
   ipp_tag_t option_tag;
 
@@ -391,7 +396,7 @@ gtk_cups_request_encode_option (GtkCupsRequest *request,
       case IPP_TAG_INTEGER:
       case IPP_TAG_ENUM:
         ippAddInteger (request->ipp_request,
-                       IPP_TAG_OPERATION,
+                       IPP_TAG_JOB,
                        option_tag,
                        option,
                        strtol (value, NULL, 0));
@@ -407,7 +412,7 @@ gtk_cups_request_encode_option (GtkCupsRequest *request,
            b = 1;
          
           ippAddBoolean(request->ipp_request,
-                        IPP_TAG_OPERATION,
+                        IPP_TAG_JOB,
                         option,
                         b);
         
@@ -439,7 +444,7 @@ gtk_cups_request_encode_option (GtkCupsRequest *request,
            upper = lower;
          
           ippAddRange (request->ipp_request,
-                       IPP_TAG_OPERATION,
+                       IPP_TAG_JOB,
                        option,
                        lower,
                        upper);
@@ -467,7 +472,7 @@ gtk_cups_request_encode_option (GtkCupsRequest *request,
             units = IPP_RES_PER_INCH;
           
           ippAddResolution (request->ipp_request,
-                            IPP_TAG_OPERATION,
+                            IPP_TAG_JOB,
                             option,
                             units,
                             xres,
@@ -526,7 +531,7 @@ gtk_cups_request_encode_option (GtkCupsRequest *request,
             {
               /* single value */
               ippAddString (request->ipp_request,
-                            IPP_TAG_OPERATION,
+                            IPP_TAG_JOB,
                             option_tag,
                             option,
                             NULL,
@@ -540,7 +545,7 @@ gtk_cups_request_encode_option (GtkCupsRequest *request,
               g_ptr_array_add (strings, next);
               
               ippAddStrings (request->ipp_request,
-                             IPP_TAG_OPERATION,
+                             IPP_TAG_JOB,
                              option_tag,
                              option,
                              strings->len,
index 8351325fb47b41c182e32ceacccce67a34a2292b..0002bd3403875e340d999667eec4dc5d60db4a1a 100644 (file)
@@ -422,9 +422,6 @@ gtk_print_backend_cups_print_stream (GtkPrintBackend         *print_backend,
   gtk_cups_request_ipp_add_string (request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
                                    NULL, cups_printer->printer_uri);
 
-  gtk_cups_request_ipp_add_string (request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
-                                   NULL, cupsUser());
-
   title = gtk_print_job_get_title (job);
   if (title)
     gtk_cups_request_ipp_add_string (request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL,